<?php $this->load->view('header', $head);?>
<div data-role="page" id="search_result">
	<div data-role="header">
		<h1>검색결과</h1>
		<a data-role="button" data-rel="back" data-icon="arrow-l">Back</a>
	</div><!-- /header -->
	<div data-role="content">
		<div class="content-primary">		<!-- start of content-primary -->
			<ul data-role="listview">
				<?php if(!empty($s_results)){ foreach($s_results as $k => $i): ?>
				<?php 
						  $buff = strtotime($i->poll_end);
						 	 if(time() > strtotime($i->poll_end)) : ?> 	<!-- expired polls have different list element color -->
				<li data-theme = "e"><a href="<?=site_url('poll/result_question/'.$i->id)?>">						
							<?php else :?>				                <!-- ongoing polls -->          
				<li data-theme = "c">
					<input type="hidden" class="poll-opt" value="<?=$i->id?>;<?=$i->mid_show?>" />
					<a href = "#"> 
							<?php endif;?>
		
					<h3><?=$i->title?></h3>								<!-- print out poll information -->
					<p><strong><?=$i->keyword?></strong></p>
					<p><?=$i->poll_start?> ~ <?=$i->poll_end	?></p>
					<p class="ui-li-aside"><strong><?=category_str($i->category)?></strong></p>
				
				</a></li>
				<?php endforeach; }
				else{ ?>
					<h1> 검색 결과가 없습니다. </h1>
				<?php } ?>
		</ul>
		</div><!--/content-primary -->		
	</div><!-- /content -->
	<div data-role="footer" data-position="fixed">
		<?=$this->load->view('navbar', array('active' => 'search'))?> 
	</div>
</div>

<?php $this->load->view('footer'); ?>